inspector: Don't leak recordings
authorMatthias Clasen <mclasen@redhat.com>
Thu, 18 Jan 2018 00:12:27 +0000 (19:12 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 18 Jan 2018 00:12:55 +0000 (19:12 -0500)
g_list_model_get_item is transfer full, so we need
to drop the references we get from it. This was showing
up while testing the GL texture cache in GtkGLArea.

gtk/inspector/recorder.c

index 921b21d778bac203f0091d59db45af1946f18d95..32dcfb0db716ac03e0ef4703a4d3fb1233df549b 100644 (file)
@@ -120,6 +120,9 @@ recordings_list_row_selected (GtkListBox           *box,
     }
 
   gtk_tree_view_expand_all (GTK_TREE_VIEW (priv->render_node_tree));
+
+  if (recording)
+    g_object_unref (recording);
 }
 
 static void
@@ -773,6 +776,8 @@ gtk_inspector_recorder_recordings_list_create_widget (gpointer item,
         {
           GtkInspectorRecording *r = g_list_model_get_item (priv->recordings, i);
 
+          g_object_unref (r);
+
           if (r == recording)
             break;